﻿@using ETD.Common.Extension;
@using ETD.WebOrganization.Libs.Helper;
@using ETD.WinClient.Config;
@using ETD.Domain.EnumModels;
@using ETD.Domain.WebModels;
@using ETD.Common;
@model ETD.WebOrganization.Areas.Web.Models.ContactServiceModel
@{
    ViewBag.Title = "联系客服";

}

<style>
    .weui-center {
        text-align: center;
    }

    .menu_item_left_icon {
        width: 22px !important;
        margin-right: 8px !important;
        display: block;
    }

    .WpSecurityTableLink {
    }

    .weui-form-preview__ft {
        /*margin-top: 45px;*/
    }

    .contact-header {
        padding: 35px 0;
    }

    .contact-title {
        text-align: center;
        font-size: 34px;
        color: #3cc51f;
        font-weight: 400;
        margin: 0 15%;
    }

    .contact_service_weixin {
        text-align: center;
    }

        .contact_service_weixin img {
            width: 50%;
            max-width: 200px;
        }
</style>
<div class="weui-panel">
    <header class="contact-header">
        <h1 class="contact-title">联系方式</h1>
    </header>


    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__hd"><img class="menu_item_left_icon" src="@Url.MapMvcAssets("Images/icon_info_gray.png")"></div>
            <div class="weui-cell__bd">
                <p>电话</p>
            </div>
            <div class="weui-cell__ft">18817703930</div>
        </div>
        <div class="weui-form-preview__ft">
            <a class="weui-form-preview__btn weui-form-preview__btn_primary" href="javascript:">拨打</a>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><img class="menu_item_left_icon" src="@Url.MapMvcAssets("Images/icon_info_gray.png")"></div>
            <div class="weui-cell__bd">
                <p>微信</p>
            </div>
            <div class="weui-cell__ft">18817703930</div>
        </div>
        <div class="weui-form-preview__ft">
            <a class="weui-form-preview__btn weui-form-preview__btn_primary" href="javascript:">识别下方二维码添加客服微信</a>
        </div>
        <div class="contact_service_weixin">
            <img src="@Url.MapMvcAssets("NormalImages/contact_service_weixin.jpg")" />
        </div>
    </div>

</div>

@section ScriptSection{
    <script>
        $(function () { CurrentSecurityTableObject.Init(); });
        var CurrentSecurityTableObject = {
            Init: function () {
                $(".WpSecurityTableLink").click(CurrentSecurityTableObject.OnWpSecurityTableLinkClick);
            },
            OnWpSecurityTableLinkClick: function () {
                $this = $(this);
                console.log($this.data("name"));
                console.log($this.data("wpsecuritytableid"));
                CurrentSecurityTableObject.SelectedWpSecurityTableLink = {
                    "Name": $this.data("name"),
                    "WpSecurityTableID": $this.data("wpsecuritytableid")
                };
                CurrentSecurityTableObject.OpenActionMenu();
            },
            SelectedWpSecurityTableLink: null,
            OpenActionMenu: function () {
                $.actions({
                    title: "选择操作",
                    onClose: function () {
                        console.log("close");
                    },
                    actions: [
                      {
                          text: "切换到>>" + CurrentSecurityTableObject.SelectedWpSecurityTableLink.Name,
                          className: "color-primary",
                          onClick: function () {
                              CurrentSecurityTableObject.OnActionMenuSwitchClick();
                          }
                      },
                      //{
                      //    text: "删除",
                      //    className: 'color-danger',
                      //    onClick: function() {
                      //        $.alert("你选择了“删除”");
                      //    }
                      //}
                    ]
                });
            },
            OnActionMenuSwitchClick: function () {
                var paras = {};
                paras.WpSecurityTableID = CurrentSecurityTableObject.SelectedWpSecurityTableLink.WpSecurityTableID;
                ajaxPost("@Url.Action("SwitchToWpSecurityTable", "SecurityTable")", paras, function (data) {
                    console.log(data);
                    if (data.Status) {
                        $.toast("操作完成!");
                        setTimeout(function () {
                            window.location.reload();
                        }, 1000);
                    } else {
                        $.toast(data.Info, "forbidden");
                    }
                });

            }

        };

    </script>
}